//Esta Classe eh responsavel por conversar com o ArduinoScara

#ifndef ARDUINOSCARA_H
#define ARDUINOSCARA_H

#define ARDUINO_SCARA 1
#define ARDUINO_OMNI 2

#include <cstring>
#include <iostream>
#include <stdlib.h>
#include <fstream>
#include <unistd.h>  /* UNIX standard function definitions */
#include <fcntl.h>   /* File control definitions */
#include <errno.h>   /* Error number definitions */
#include <termios.h> /* POSIX terminal control definitions */
#include <sys/time.h>
#include "serial.h"


using namespace std;

class arduino : public serial
{
	public:
		arduino( int whichOne );
		~arduino();
		
		
		int writeCmd(int ang, char identifier, int whichOne);
		int writeScaraServos(int theta1, int theta2, int theta_ef);
		int readArduino( char identificador, int cmd, int whichOne, char* resposta);
		int serialFlush(int whichOne);
		
	protected:
	  
		struct timeval t_envio;
		long int timeOut;
		int fdScara;
		int fdOmni;
		int numSeq;
};

#endif

